$(function () {

    // var shop_chart1 = echarts.init($("#shopingCharts"));
    $("#jqGrid").Grid({
        url: '../invoicing/goodsCounting',
        colModel: [
            {label: '商品名称', name: 'goodsName', index: 'goods_name', width: 80},
            {label: '商品序列号', name: 'goodsSn', index: 'goods_sn', width: 80},
            {label: '商品规格', name: 'specificationName', index: 'specification_name', width: 80},
            {label: '销量', name: 'invoicingNum', index: 'invoicing_num', width: 80},
           ]
    });
});

var vm = new Vue({
    el: '#rrapp',
    data: {
        showList: true,
        title: null,
        dataRange: '',
        schoolList:[],

        q:{
            beginTime:'',
            endTime:'',
            goodsName:'',
            goodsSn:''
        }
    },
    methods: {
        query: function () {
            vm.reload();
        },
        reloadSearch:function(){
            vm.q={
                beginTime:'',
                endTime:'',
                schoolId:'',
                shopName:'',
            }
        },
        reload: function (event) {
            vm.showList = true;
            var page = $("#jqGrid").jqGrid('getGridParam', 'page');
            $("#jqGrid").jqGrid('setGridParam', {
                postData: {
                    'beginTime':vm.q.beginTime,
                    'endTime':vm.q.endTime,
                    'goodsName':vm.q.goodsName,
                    'goodsSn': vm.q.goodsSn,
                },
                page: page
            }).trigger("reloadGrid");
        },

        handleChange: function(daterange) {
            vm.q.beginTime = daterange[0];
            vm.q.endTime = daterange[1];
        }

    }
});